﻿#ifndef D3dInterface_h__
#define D3dInterface_h__
#include <d3d11.h>
#include <d2d1.h>
#include <dxgi1_2.h>

namespace SkyEngine2d
{
	
	class Vector2;
	
	/*!
	 \brief Direct11 绘制相关的接口
	 \details
	*/
	class IDirectRender
	{
	public:
	
		//! 获取d3d 设备
		/*!
		\return ID3D11Device *
		*/
		virtual ID3D11Device* getD3dDevice() = 0;
	
		//! 获取d3d 设备上下文
		/*!
		\return ID3D11DeviceContext*
		*/
		virtual ID3D11DeviceContext* getD3dDeviceContext() = 0;
	
		//! 获取d3d 渲染目标
		/*!
		\return ID3D11RenderTargetView*
		*/
		virtual ID3D11RenderTargetView* getD3dRenderTargetView() = 0;
		
		//! 获取d3d 交换链
		/*!
		\return IDXGISwapChain1* 
		*/
		virtual IDXGISwapChain1* getD3dSwapChain() = 0;
		
		//! 获取深度缓存视图
		/*!
		\return ID3D11DepthStencilView*  
		*/
		virtual ID3D11DepthStencilView* getD3dDepthStencilView() = 0;
		
		//! 清理d3d
		/*!
		\return void  
		*/
		virtual void ClearDirect3D() = 0;
		
		//! 重置视图大小
		/*!
		\param HWND hwnd 当前窗口句柄
		\param UINT w 视图的宽
		\param UINT h 视图的高
		\return void  
		*/
		virtual void onResize(HWND hwnd, UINT w, UINT h) = 0;
	
		//! 获取d2d 渲染目标
		/*!
		\return ID2D1RenderTarget* 
		*/
		virtual ID2D1RenderTarget* getD2dRenderTarget() = 0;
		
		//! 获取dpi 值
		/*!
		\return float  
		*/
		virtual float getDpi() = 0;
	};
	
}

#endif // D3dInterfface_h__
